<?php

class Map extends AppModel {
    var $name = 'Map';

    var $fields = array();

    var $validate = array(  );

    /**
	 * Get all
	 *
	 * @param type  meta
	 * @return type  meta
	 * @access public
	 */
	function getAll(){
		return $this->find('all', array(
			//'fields' => $this->fields,
			'conditions' => array(
				'status' => 4,
			),
			'order' => array('sort' => 'ASC')
		));
	}

	/**
	 * get list
	 *
	 * @param type  meta
	 * @return type  meta
	 * @access public
	 */
	function getList() {
		return $this->find('list', array(
			'fields' => array('id', 'name'),
			'conditions' => array(
				'status' => 4,
			),
			'order' => array('sort' => 'ASC')
		));
	}


	/**
	 * Get info by id
	 *
	 * @param type  meta
	 * @return type  meta
	 * @access public
	 */
	function getInfoById($id = null, $fields = array()){
		if(empty($id)) return array();

		return $this->find('first', array(
			'fields' => $fields,
			'conditions' => array(
				'id' => $id,
				'status' => 4
			)
		));
	}

}
